Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(decryption): ensure values are positive #4

Merged
merged 1 commit into from
Dec 5, 2018
Merged

Conversation

dignifiedquire
Copy link
Member

@dignifiedquire dignifiedquire commented Dec 4, 2018

When decrypting, care has to be taken to ensure that negative numbers are brought back into the positive range.

In most cases the if < 0 then += prime was enough, but if the number was more negative than the prime, we ended up with still a negative number. So this was changed to use a while statement, which ensures the right thing always happens.

Fixes #2

@dignifiedquire dignifiedquire mentioned this pull request Dec 4, 2018
@dignifiedquire dignifiedquire changed the title [WIP] try to figure out more about the key gen failure fix(decryption): ensure values are positive Dec 4, 2018
@dignifiedquire dignifiedquire merged commit 90975f3 into master Dec 5, 2018
@dignifiedquire dignifiedquire deleted the test branch December 5, 2018 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant